﻿
Partial Class photoalbums_Default
    Inherits System.Web.UI.Page

    Private _AlbumID As Integer
    Public Property AlbumID() As Integer
        Get
            Return _AlbumID
        End Get
        Set(ByVal value As Integer)
            _AlbumID = value
        End Set
    End Property

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim albumAdapter As New MainDbTableAdapters.AlbumsTableAdapter()

        lstAlbums.DataSource = albumAdapter.GetAuthAlbums(User.Identity.Name)
        lstAlbums.DataBind()

        AlbumID = Request.QueryString("albumID")

    End Sub

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        Dim imageAdapter As New MainDbTableAdapters.ImagesTableAdapter()

        If AlbumID > 0 Then
            lstImages.DataSource = imageAdapter.GetImagesByAlbumID(AlbumID, User.Identity.Name)
            lstImages.DataBind()

            lstImages.Visible = True
        End If



    End Sub

End Class
